import Cookies from 'js-cookie'

const ACCESS_TOKEN_KEY = 'access-token'

const EXPIRES_IN_KEY = 'expires-in'

export function getToken() {
  return Cookies.get(ACCESS_TOKEN_KEY)
}

export function setToken(token : string) {
  return Cookies.set(ACCESS_TOKEN_KEY, token)
}

export function removeToken() {
  return Cookies.remove(ACCESS_TOKEN_KEY)
}

export function getExpiresIn() {
  return Cookies.get(EXPIRES_IN_KEY) || -1
}

export function setExpiresIn(time : string) {
  return Cookies.set(EXPIRES_IN_KEY, time)
}

export function removeExpiresIn() {
  return Cookies.remove(EXPIRES_IN_KEY)
}
